import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import getters from './getters'
import mutations from './mutations'
import actions from './actions'
import createPersistedState from 'vuex-persistedstate' // vuex持久化

Vue.use(Vuex)

export default new Vuex.Store({
	plugins: [
		createPersistedState({
			// storage: window.sessionStorage // vuex持久化
			storage: window.localStorage // vuex持久化
		})
	],
	state,
	getters,
	mutations,
	actions,
	modules: {}
})
